package com.bqtv.sport.ui.mine

import android.content.Context
import android.content.Intent
import android.view.View
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.bqtv.sport.R
import com.bqtv.sport.adapter.HomeHotAdapter
import com.bqtv.sport.app.AppActivity
import com.bqtv.sport.commen.widget.GridItemDecoration
import com.bqtv.sport.databinding.ActivityWatchHistoryBinding

class WatchHistoryActivity : AppActivity<ActivityWatchHistoryBinding>() {
    private lateinit var detailAdapter: HomeHotAdapter

    companion object {
        fun start(context: Context) {
            val intent = Intent(context, WatchHistoryActivity::class.java)
            context.startActivity(intent)
        }
    }

    override fun getViewBinding() = ActivityWatchHistoryBinding.inflate(layoutInflater)

    override fun initView() {

        binding.rcvDetail.layoutManager =
            StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL)
        binding.rcvDetail.addItemDecoration(
            GridItemDecoration(
                getContext(), 2,
                GridItemDecoration.LineDrawMode.HORIZONTAL, 10, 15
            )
        )

        detailAdapter = HomeHotAdapter()
        binding.rcvDetail.adapter = detailAdapter

    }

    override fun initData() {
        detailAdapter.submitList(listOf("1", "2", "3", "4", "5", "6", "7"))


        initListener()
    }

    private fun initListener() {

    }

    override fun onClick(view: View) {
        super.onClick(view)
        when (view.id) {
            R.id.iv_back -> finish()
        }
    }
}